﻿<phone:PhoneApplicationPage 
    x:Class="TouristGuide.WP7.AttractionPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:cxi="clr-namespace:TouristGuide.WP7.Helpers;assembly=TouristGuide.WP7"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait"  Orientation="Portrait"
    shell:SystemTray.IsVisible="False" xmlns:my="clr-namespace:Microsoft.Phone.Controls.Maps;assembly=Microsoft.Phone.Controls.Maps">

    <Grid x:Name="LayoutRoot" Background="Transparent">

        <!--Panorama control-->
        <controls:Pivot Title="{Binding Name}">

            <!--Panorama item one-->
            <controls:PivotItem Header="info">
                <ScrollViewer>
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="*"/>
                        </Grid.RowDefinitions>

                        <!--ContentPanel - place additional content here-->
                        <StackPanel Margin="12,0,0,28">
                            <TextBlock Text="Country: " Foreground="Gray"/>
                            <TextBlock Text="{Binding Country}" Margin="10,10,0,10"/>
                            <TextBlock Text="Region: " Foreground="Gray"/>
                            <TextBlock Text="{Binding Region}" Margin="10,10,0,10"/>
                            <TextBlock Text="Address: " Foreground="Gray"/>
                            <StackPanel Orientation="Horizontal" Margin="10,10,0,10">
                                <TextBlock Text="{Binding Street}" />
                                <TextBlock Text=" "/>
                                <TextBlock Text="{Binding BuildingNumber}"/>
                            </StackPanel>
                        </StackPanel>
                        <StackPanel Margin="21,240,0,571">
                            <Button Content="Map" Click="Button_Click" Grid.RowSpan="2" />
                        </StackPanel>
                        <StackPanel Margin="12,340,0,28">
                            <TextBlock Text="{Binding Description}" TextWrapping="Wrap" />
                        </StackPanel>
                        <!--<phone:WebBrowser cxi:WebBrowserHelper.Html="{Binding Description, Mode=TwoWay}" Name="webBrowserDescription" Margin="12,56,0,448" Grid.Row="1" Background="Black" Foreground="White" />-->

                    </Grid>
                </ScrollViewer>
            </controls:PivotItem>

            <!--Panorama item two-->
            <controls:PivotItem Header="reviews">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>

                    <ListBox 
                        Name="ReviewsListBox"
                        SelectionMode="Multiple"
                        DataContext="{Binding Reviews, Mode=TwoWay}"
                        ItemsSource="{Binding}"
                        >
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <Border BorderBrush="White" BorderThickness="2" Margin="10">
                                    <StackPanel Margin="10" Width="400">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="{Binding Author}" Foreground="Gray" />
                                            <TextBlock Text=", " Foreground="Gray" />
                                            <TextBlock FontStyle="Italic" Text="{Binding Date}" Foreground="Gray" />
                                            <TextBlock Text=": " Foreground="Gray" />
                                            <TextBlock FontWeight="Bold" Text="{Binding Rating}" Foreground="Gray" />
                                            <TextBlock Text="/10 " Foreground="Gray" />
                                        </StackPanel>
                                        <TextBlock Text="{Binding Text}" TextWrapping="Wrap" />

                                    </StackPanel>
                                </Border>

                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </Grid>
            </controls:PivotItem>
        </controls:Pivot>
    </Grid>

    <!--Panorama-based applications should not show an ApplicationBar-->

</phone:PhoneApplicationPage>